package com.rupeng.service;

import java.util.List;

import com.rupeng.annotation.RupengCacheable;
import com.rupeng.annotation.RupengUseCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rupeng.mapper.QuestionMapper;
import com.rupeng.pojo.Question;

@Service
@RupengCacheable
public class QuestionService extends BaseService<Question> {
	@Autowired
    private QuestionMapper questionMapper;
	//查询出当前老师所在的所有班级的所有学生所提问的未解决的问题
    @RupengUseCache
    public List<Question> selectUnresolvedQuestionByTeacherId(Long teacherId) {
        return questionMapper.selectUnresolvedQuestionByTeacherId(teacherId);
    }
    @RupengUseCache
    //当前登录用户所提问的所有的未解决的问题，以及所参与回复的所有的未解决的问题
    public List<Question> selectUnresolvedQuestionByStudentId(Long studentId) {
        return questionMapper.selectUnresolvedQuestionByStudentId(studentId);
    }
    @RupengUseCache
    public List<Question> selectReplyQuestionByUserId(Long userId){
        return questionMapper.selectReplyQuestionByUserId(userId);
    }
}
